/*****************************************************************/
/*Date:	  December 29, 2024										 */
/*Author: Gina Branton											 */
/*File:   Grave_Acts_Final.do			        				 */
/*Purpose: Analyze public opinion data on participation  		 */
/*			2020 CMPS. 						 					 */
/*  	Input File: 	Grave Acts Data.dta		 				 */
/*  	Output File: 	Grave_Acts.log						 */
/*****************************************************************/

set more off

use "\Grave Acts Data.dta"


log using Grave_Acts.log, replace
/* Models in Table 1 */
logit vote2 c.percap_total_police_killing##c.percap_total_police_killing dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.05).5))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xlabel(, nogrid) xline(.46) xlabel(0(.1).5) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Voting") ytitle("Pr(Vote)") xlabel(, nogrid notick) saving(vote2.gph, replace)


logit attend_protest dem ind lib mod no_ideology income income_refuse age female educ old_south c.percap_total_police_killing##c.percap_total_police_killing county_pct_black1216 county_pct_latino1216 county_pct_coll1216 cou_pct_urban county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.05).4))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xline(.38) xlabel(, nogrid) xlabel(0(.1).4) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Attending a Protest") ytitle("Pr(Attending Protest)") xlabel(, nogrid notick) saving(protest.gph, replace)


logit attend_meeting dem ind lib mod no_ideology income income_refuse age female educ old_south c.percap_total_police_killing##c.percap_total_police_killing county_pct_black1216 county_pct_latino1216 county_pct_coll1216 cou_pct_urban county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.05).4))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xline(.39) xlabel(, nogrid) xlabel(0(.1).4) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Attending a Community Meeting") ytitle("Pr(Attending Meeting)") xlabel(, nogrid notick) saving(meeting.gph, replace)

/* Figure 2. */
histogram percap_total_police_killing if e(sample), scheme(plotplain) kdensity xlabel(, nogrid) xlabel(0(.2)1.4) ylabel(, nogrid) title("Figure 2. Histogram of Police Killings Measure (African American Respondents)") xtitle("Per Capita Police Killings") xlabel(, nogrid notick) saving(histogram.gph, replace)


/* Figure 3 */
gr combine vote2.gph protest.gph meeting.gph,  scheme(plotplain) row(2) imargin(0 0 0) title("Figure 3. Impact of Police Violence on African American Political Activity") saving(activity.gph, replace)

log close


/* Appendix Table A */
logit vote2 percap_total_police_killing cou_percap_total_police_killing2 force know_jail dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)

logit attend_protest percap_total_police_killing cou_percap_total_police_killing2 force know_jail dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)

logit attend_meeting percap_total_police_killing cou_percap_total_police_killing2 force know_jail dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote  if black_resp==1  [pw=weight], cluster(stcoufips)

/* Appendix Table B */
logit vote2 total_police_killing total_police_killing2 dem ind lib mod no_ideology income income_refuse age female educ old_south county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)

logit attend_protest total_police_killing total_police_killing2 dem ind lib mod no_ideology income income_refuse age female educ old_south county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote  if black_resp==1  [pw=weight], cluster(stcoufips)

logit attend_meeting total_police_killing total_police_killing2 dem ind lib mod no_ideology income income_refuse age female educ old_south county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote   if black_resp==1  [pw=weight], cluster(stcoufips)


/* Appendix Table C */
logit vote2 c.percap_total_police_killing##c.percap_total_police_killing dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)

summarize vote2 attend_protest attend_meeting dem ind lib mod no_ideology income income_refuse age female educ old_south percap_total_police_killing county_pct_black1216 county_pct_latino1216 county_pct_coll1216 cou_pct_urban county_rep_pres_vote if e(sample)

/* Appendix Figure A */
logit vote2 c.percap_total_police_killing##c.percap_total_police_killing dem ind lib mod no_ideology income income_refuse age female educ old_south  county_pct_black1216 county_pct_latino1216 cou_pct_urban county_pct_coll1216 county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.1)1.42))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xlabel(, nogrid) xline(.46) xlabel(0(.2)1.4) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Voting") ytitle("Pr(Vote)") xlabel(, nogrid notick) saving(vote2.gph, replace)

logit attend_protest dem ind lib mod no_ideology income income_refuse age female educ old_south c.percap_total_police_killing##c.percap_total_police_killing county_pct_black1216 county_pct_latino1216 county_pct_coll1216 cou_pct_urban county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.1)1.42))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xlabel(, nogrid) xline(.38) xlabel(0(.2)1.4) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Attending a Protest") ytitle("Pr(Attending Protest)") xlabel(, nogrid notick) saving(protest.gph, replace)

logit attend_meeting dem ind lib mod no_ideology income income_refuse age female educ old_south c.percap_total_police_killing##c.percap_total_police_killing county_pct_black1216 county_pct_latino1216 county_pct_coll1216 cou_pct_urban county_rep_pres_vote if black_resp==1  [pw=weight], cluster(stcoufips)
margins, at(percap_total_police_killing=(0(.1)1.42))
marginsplot, scheme(plotplain) xtitle("Per Capita Police Violence") xlabel(, nogrid) xline(.39) xlabel(0(.2)1.4) ylabel(, nogrid) plot1opts(msymbol(O) mcolor(black) lcolor(black) lwidth(med)) ci1opts(lcolor(black)) title("Probability of Attending a Community Meeting") ytitle("Pr(Attending Meeting)") xlabel(, nogrid notick) saving(meeting.gph, replace)

gr combine vote2.gph protest.gph meeting.gph,  scheme(plotplain) row(2) imargin(0 0 0) title("Figure A. Impact of Police Violence on African American Political Activity") saving(activity.gph, replace)



